package maa.action.factory;

import maa.action.*;
import maa.action.Action;

import java.util.HashMap;

public class ActionFactory {
    HashMap<String,Action> actionMap = new HashMap<String, Action>();
    public ActionFactory() {
        actionMap = new HashMap<>();
        actionMap.put("GET/GET/register", new ViewAction("registration"));
        actionMap.put("POST/POST/login", new LoginPost());
        actionMap.put("POST/POST/register", new RegisterPost());
        actionMap.put("GET/GET/login", new ViewAction("login"));
        actionMap.put("GET/account", new AccountGet());
        actionMap.put("GET/main", new ViewAction("main"));
    }
    public Action getAction(String actionName){
        Action action = actionMap.get(actionName);
        return action;
    }
}
